/********************************************************************************
 *      Copyright:  (C) 2024 LiYi<1751425323@qq.com>
 *                  All rights reserved.
 *
 *       Filename:  mqtt_conf.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(25/04/24)
 *         Author:  LiYi <1751425323@qq.com>
 *      ChangeLog:  1, Release initial version on "25/04/24 11:31:45"
 *                 
 ********************************************************************************/

#ifndef MQTT_CONF_H
#define MQTT_CONF_H


#define SIZE                1024
#define KEEP_ALIVE          60

enum{
	SUB ,
	PUB
};


typedef struct mqtt_user_data
{
	char    brokeraddress[SIZE] ;
	int     brokerport;
	char    username[SIZE];
	char    password[SIZE];
	char    clientid[SIZE];
	char    topic[SIZE];
	int     Qos;

	char    method[SIZE] ;
	char    time[SIZE];
	char    jsonid[SIZE] ;
	char    identifier[SIZE] ;
	char    version[SIZE] ;

}mqtt_user_data;


int set_config(char *path,char *host,int port, char *clientid,char *uname,char *pwd,char *topic);

int get_config(char *path, mqtt_user_data *mqtt, int mode);

#endif

